package com.cjy.ComparatorDemo1;

import java.util.Comparator;

public class ComparatorClass implements Comparator<ComparatorBusiness> , java.io.Serializable{
    @Override
    public int compare(ComparatorBusiness o1, ComparatorBusiness o2) {
        double grades1 = o1.getGrades();
        double grades2 = o2.getGrades();


        if (grades1 < grades2) {
            return -1;
        }else if (grades1 == grades2) {
            return 0;
        }else{
            return 1;
        }
    }
}
